/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ConnexionView.java
 *
 * Created on 2011-06-11, 21:57:30
 */

package ca.etsmtl.log660.view;

import java.awt.event.ActionListener;
import javax.swing.JPanel;

/**
 *
 * @author iamthegD
 */
public class ConnexionView extends JPanel {

    /** Creates new form ConnexionView */
    public ConnexionView() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jTextFieldCourriel = new javax.swing.JTextField();
        jTextFieldPassword = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jButtonConnexion = new javax.swing.JButton();
        jLabelErreur = new javax.swing.JLabel();

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel1.setText("Bienvenue chez Webflix");

        jLabel3.setText("Adresse courriel:");

        jTextFieldCourriel.setText("MalcolmMHumphries7@hotmail.com");
        jTextFieldCourriel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldCourrielActionPerformed(evt);
            }
        });

        jTextFieldPassword.setText("geiDie9m");

        jLabel4.setText("Mot de passe : ");

        jButtonConnexion.setText("Connexion");

        jLabelErreur.setForeground(new java.awt.Color(255, 0, 0));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelErreur, javax.swing.GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE)
                    .addComponent(jLabel1)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel3))
                        .addGap(26, 26, 26)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jTextFieldPassword)
                            .addComponent(jTextFieldCourriel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)
                            .addComponent(jButtonConnexion, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextFieldCourriel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel4)
                    .addComponent(jTextFieldPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButtonConnexion)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelErreur)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jTextFieldCourrielActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldCourrielActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jTextFieldCourrielActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonConnexion;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabelErreur;
    private javax.swing.JTextField jTextFieldCourriel;
    private javax.swing.JTextField jTextFieldPassword;
    // End of variables declaration//GEN-END:variables

    public void addConnexionListener(ActionListener listener) {
        jButtonConnexion.addActionListener(listener);
    }

    public String getJTextFieldCourriel(){
        return jTextFieldCourriel.getText();
    }

    public String getJTextFieldPassword(){
        return jTextFieldPassword.getText();
    }

    public void setJTextFieldErreur(String error){
        jLabelErreur.setText(error);
    }
}
